// import { createApp } from 'vue'
// import './style.css'
// import App from './App.vue'

// createApp(App).mount('#app')

import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
import {
  renderWithQiankun,
  qiankunWindow,
} from "vite-plugin-qiankun/dist/helper";
let app: any;
import actions from "./shared/actions";

//判断是否为 qiankun 环境
if (!qiankunWindow.__POWERED_BY_QIANKUN__) {
  createApp(App).mount("#app");
} else {
  renderWithQiankun({
    mount(props:any) {
      actions.setActions(props);
      app = createApp(App);
      app.mount(props.container.querySelector("#app"));
    },
    bootstrap() {
      console.log("vue app bootstrap");
    },
    update() {
      console.log("vue app update");
    },
    unmount() {
      console.log("vue app unmount");
      app?.unmount();
    },
  });
}
